<template>
    <div class="code">
        <div class="header"><img class="return_img" src="@/assets/Return.png" style="width:.23rem;height:.4rem;" v-on:click="back">微信授权</div>
        <div class="content">
            <div class="img">
                 <img  src="@/assets/code.png" alt="" style="width:1.12rem">
            </div>
            <p>请绑定微信，提现的金额，会直接转到您绑定的微信 红包中，请注意查收。</p>
        </div>
    </div>
</template>

<script>

import { getWechatInfo } from '@/service/home.js';
import { XButton } from 'vux'
export default {
    components:{
        XButton
    },
    data(){
        return{
            code:'111',
            token: sessionStorage.token,
            url : ''
        }
    },
    mounted(){       
        this.wechatAuth();
        this.get_url();
    },
    methods:{
        wechatAuth(){
            // //var url = 'http://192.168.10.122:8080/#/my/code';
            var url = 'http://staff.ihotelvip.com/my/CashWithdrawal';
            var appid = 'wx9a16008c72a9cf50'
            url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid="+ appid +"&redirect_uri="	+url				
                + "&response_type=code&scope=snsapi_userinfo&state=STATE&connect_redirect=1#wechat_redirect";
                  window.location.href = url
        },
        get_url(){
            this.code = this.$route.query.code;      
        },
        back(){
            this.$router.push({path:'/my/recommend'})
        },
    }
}
</script>
<style  scoped lang="less">
.code{
    .content{
        height: 4rem;
        background: #fff;
        padding-top: .48rem;
        .img{
            width: 1.12rem;
            margin:  0 auto;
        }
        p{
            color: #999999;
            font-size: .3rem;
            text-align: center;
        }
    }
}
</style>
